<?php
class Views_Helpers_ShowEntranseForm extends Zend_View_Helper_Abstract{
        public $view;
        public function setView(Zend_View_Interface $view){
            $this->view = $view;
        }

	public function showEntranseForm(){
            $jquery = $this->view->jQuery();
            $jquery->enable();
            $jqHandler = ZendX_JQuery_View_Helper_JQuery::getJQueryHandler();

            $function = '
                $("#password-clear").show();
                $("#password").hide();
                $("#password-clear").focus(function(){
                    $("#password-clear").hide();
                    $("#password").show();
                    $("#password").focus();
                });
                $("#password").blur(function(){
                    if($("#password").val() == "") {
                        $("#password-clear").show();
                        $("#password").hide();
                    }
                });

                $("#creammagenter").click(function(){
                    $("#creammagenterform").submit();
                });
            ';

            if($jqHandler == '$') $jqHandler = '';
            $jquery->addOnload($jqHandler . $function);


            $way = $this->view->url(array('controller' => 'login', 'action' => 'index'), 'default',  true);
            $form = '<form action="/login/login" method="post" id="creammagenterform" class="creammagEntranceForm">
                <div class="classDefaultFormEnterUsermail">
                    <p ><input type="text"'
                  . ' name="login"'
                  . ' id="login"'
                  . ' value="электронная почта"'
                  . '/>'
                  . '</p></div>
                      <div class="classDefaultFormRegisterUserpassword">
                    <p >
                    <input type="text"'
                  . ' name="password-clear"'
                  . ' id="password-clear"'
                  . ' value="пароль"'
                  . '/>'

                  . '<input type="password"'
                  . ' name="password"'
                  . ' id="password"'
                  . ' value=""'
                  . '/>'

                  . '</p></div>
                      <div class="classDefaultFormLoginSubmitlogin">
                    <p style="padding-left:30px; padding-top:10px;">'
                  . '<a class="loginlink" href="#" id="creammagenter" style="text-decoration:none; padding-right:10px;">вход</a>'
                  . '/'
                  . '<a class="loginlink" href="/registration" style="text-decoration:none; padding-left:10px;">регистрация</a>'
                  . '</p></div>
                    </form>';
            return $form;
	}
}